<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>对字符串和数字进行加法运算</title>
</head>

<body>
    <p>点击按钮创建及增加字符串变量。</p>
    <button onclick="myFunction()">点击这里</button>
    <p id="demo"></p>
    <script>
        function myFunction() {
            var x = 5 + 5;
            var y = "5" + 5;
            var z = "Hello" + 5;
            var demoP = document.getElementById("demo");
            demoP.innerHTML = x + "<br>" + y + "<br>" + z;
        }
    </script>
</body>

</html>